package service;

import mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.MyUser;

import java.util.List;

/**
 * author: 李林凯
 * time:2025/6/17 09:13
 **/
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public MyUser selectUserById(int id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public List<MyUser> selectAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public int insertUser(MyUser user) {
        return userMapper.insertUser(user);
    }

    @Override
    public int updateUser(MyUser user) {
        return userMapper.updateUser(user);
    }

    @Override
    public int deleteUserById(int id) {
        return userMapper.deleteUserById(id);
    }

    @Override
    public List<MyUser> getUserByPage(Integer page, Integer pageSize) {
        return userMapper.getUserByPage(page, pageSize);
    }

    @Override
    public int getUserCount() {
        return userMapper.getUserCount();
    }
}
